class Solution {
public:
    string losingPlayer(int x, int y) {
        int flag = 1;  //  1*x    4*y
        while (x >= 1 && y >= 4)
        {
            x -= 1;
            y -= 4;
            flag = -flag;
        }
        if (flag == 1)return "Bob";
        if (flag == -1)return "Alice";
        return "";

    }
}; class Solution {
public:
    int hash[26] = { 0 };
    int minimumLength(string s) {
        int m = s.size();
        for (auto e : s)
        {
            hash[e - 'a']++;
        }
        int i = 0;
        while (i < 26)
        {

            if (hash[i] >= 3)
            {
                hash[i] -= 2;
                m -= 2;

            }
            if (i == 25)
                i = 0;
            else
                i++;
            int cnt = 0;
            for (int j = 0; j < 26; j++)
            {
                if (hash[j] < 3)cnt++;
            }
            if (cnt == 26)break;


        }

        return m;



    }
}; class Solution {
public:
    bool doesAliceWin(string s) {
        int cnt = 0;
        for (auto e : s)
        {
            if (e == 'a' || e == 'e' || e == 'i' || e == 'o' || e == 'u')
            {
                cnt++;
            }
        }
        if (cnt % 2 != 0)
        {
            return true;
        }
        int i = 0;
        while (i < s.size())
        {
            int ret = 0;
            if (cnt % 2 != 0)
            {
                return true;
            }
            for (; i < s.size(); i++)
            {
                if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
                {
                    ret++;
                }
                if (ret == cnt - 1)
                {
                    break;
                }
            }
            cnt -= ret;
            int num = 0;
            if (cnt % 2 == 0)
                return false;
            for (; i < s.size(); i++)
            {
                if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
                {
                    num++;
                }

                if (num == cnt - 1)
                {
                    break;
                }

            }
            ret -= num;
        }


        return true;








    }
};